﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript" src="../Scripts/jquery.js"></script>
<script type="text/javascript" src="../Scripts/Verify.js"></script>
<link href="../Styles/Public.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>输入是否相同</h1>
<h2>概述</h2>
<div class="desc">
  <p>最常见的应用场景就是密码输入，在控件上设置 <strong>sametarget</strong>实现当前控件与指定控件的相同验证。</p>
  <p>&lt;input name=&quot;pw1&quot; type=&quot;text&quot;/&gt;</p>
  <p>&lt;input name=&quot;pw2&quot; type=&quot;text&quot; <strong>sametarget=&quot;pw1&quot;</strong>/&gt;（与name="pw1"的控件录入相同）</p>
</div>
<h2>示例</h2>
<h3>1、验证两次录入是否相同</h3>
<div class="desc">
  <fieldset>
    
    <pre>&lt;form onsubmit=&quot;alert('验证成功');return false;&quot;&gt;<br />      &lt;p&gt; 密码：<br />        &lt;input name=&quot;pw1&quot; type=&quot;password&quot; value=&quot;&quot; nullable=&quot;false&quot; /&gt;<br />      &lt;/p&gt;<br />      &lt;p&gt; 确认：<br />        &lt;input name=&quot;pw2&quot; type=&quot;password&quot; <strong>sametarget=&quot;pw1&quot;</strong>/&gt;<br />      &lt;/p&gt;<br />      &lt;p&gt;<br />        &lt;input type=&quot;submit&quot; name=&quot;button&quot; class=&quot;button&quot; value=&quot;验证表单&quot; verify=&quot;true&quot;/&gt;<br />      &lt;/p&gt;<br />    &lt;/form&gt;</pre>
    <form onsubmit="alert('验证成功');return false;">
      <p> 密码：
        <input name="pw1" type="password" value="" nullable="false" />
      </p>
      <p> 确认：
        <input name="pw2" type="password" sametarget="pw1"/>
      </p>
      <p>
        <input type="submit" name="button" class="button" value="验证表单" verify="true"/>
      </p>
    </form>
  </fieldset>
  
</div>

</body>
</html>
